package thread.java20221201;

class MyThread3 extends Thread{
    @Override
    public void run() {
        while (true){
            System.out.println("hello thread");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
public class Demo2 {
    public static void main(String[] args) {
        Thread thread = new MyThread3();
        thread.start();
    }
}
